zip

inline fun <E, A, B, C> Outcome<E, A>.zip(other: Outcome<E, B>, f: (A, B) -> C): Outcome<E, C>(source)

Zip allows you to combine two or more Outcomes easily with a supplied function.

Present(2).zip(Present(3)) { a, b -> a + b }     // Present(5)
Present(2).zip(Absent) { a, b -> a + b } // Absent
Present(2).zip(Failure("nup")) { a, b -> a + b } // Failure("nup")

inline fun <E, A, B, C, D> Outcome<E, A>.zip(o1: Outcome<E, B>, o2: Outcome<E, C>, crossinline f: (A, B, C) -> D): Outcome<E, D>(source)
inline fun <E, A, B, C, D, EE> Outcome<E, A>.zip(o1: Outcome<E, B>, o2: Outcome<E, C>, o3: Outcome<E, D>, crossinline f: (A, B, C, D) -> EE): Outcome<E, EE>(source)
inline fun <E, A, B, C, D, EE, F> Outcome<E, A>.zip(o1: Outcome<E, B>, o2: Outcome<E, C>, o3: Outcome<E, D>, o4: Outcome<E, EE>, crossinline f: (A, B, C, D, EE) -> F): Outcome<E, F>(source)